﻿<%@ Page Language="C#" MasterPageFile="~/admin/MasterPageAdmin.master" AutoEventWireup="true" CodeFile="ManageNews.aspx.cs" Inherits="admin_ManageNews" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<div class="contentContainer page_un" style="padding-top:20px;">
                    <div class="contentPadd un">
                        <div class="prods_content prods_table">
<form runat=server id="ManageNews">
<asp:GridView ID="grdNews" runat="server" AllowPaging="True" 
			    AutoGenerateColumns="False" DataKeyNames="News_ID" Width="100%" 
    BorderStyle="Solid" BorderWidth="3px" 
			    PageSize="5"
			    CellPadding="0" 
			    OnPageIndexChanging="grdNews_PageIndexChanging" 
			    OnRowCommand="grdNews_RowCommand" OnRowDataBound="grdNews_RowDataBound" 
    BorderColor="#CCCCCC">
			    <Columns>        
				     <asp:TemplateField HeaderText="Tùy chọn">
					     <HeaderStyle BackColor="#D4D4D4" ForeColor="#888888" HorizontalAlign="Center" 
                             VerticalAlign="Middle" />
					    <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
					    <ItemTemplate>
						    <asp:CheckBox ID="chkCheck" runat="server" />                               
					    </ItemTemplate>
				    </asp:TemplateField> 
				    <asp:TemplateField HeaderText="ID">            
					    <HeaderStyle BackColor="#D4D4D4" ForeColor="#888888" HorizontalAlign="Center" 
                            VerticalAlign="Middle" />
					    <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
					    <ItemTemplate>
						    <asp:Label ID="News_ID" runat="Server" Text='<%#Eval("News_ID") %>' ></asp:Label>
					    </ItemTemplate>
				    </asp:TemplateField>				 
				     <asp:TemplateField HeaderText="Tiêu đề">            
					     <HeaderStyle BackColor="#D4D4D4" ForeColor="#888888" HorizontalAlign="Center" 
                             VerticalAlign="Middle" />
					    <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
					    <ItemTemplate>
					        <a href='<%# "EditNews.aspx?News_ID=" + Eval("News_ID") %>'>
						        <asp:Label ID="Product_Pro_Name" runat="Server" Text='<%#Eval("News_Title") %>'></asp:Label>
						    </a>
					    </ItemTemplate>
				    </asp:TemplateField>    
				        
				     <asp:TemplateField HeaderText="Ngày viết">            
					     <HeaderStyle BackColor="#D4D4D4" ForeColor="#888888" HorizontalAlign="Center" 
                             VerticalAlign="Middle" />
					    <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
					    <ItemTemplate>
						    <asp:Label ID="News_CreateDate" runat="Server" Text='<%#Eval("News_CreateDate") %>'></asp:Label>
					    </ItemTemplate>
				    </asp:TemplateField>	
    			    
    			    <asp:TemplateField  HeaderText="Hiển thị">
					    <ControlStyle Height="16px" Width="16px" />
                        <HeaderStyle BackColor="#D4D4D4" ForeColor="#888888" HorizontalAlign="Center" 
                            VerticalAlign="Middle" />
					<ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
					<ItemTemplate>
						<asp:ImageButton ID="btnActive" 
						CommandArgument='<%# Eval("News_ID") %>' 
						CommandName="active_News"  ImageUrl="Images/check.gif" 
						runat="server" OnClientClick = "javascript:return confirm('Bạn có chắc chắn không ?');"/></a>                            
					</ItemTemplate>
				</asp:TemplateField>     
    				     
				    <asp:TemplateField >
					    <ControlStyle Height="16px" Width="16px" />
                        <HeaderStyle BackColor="#D4D4D4" ForeColor="#888888" HorizontalAlign="Center" 
                            VerticalAlign="Middle" />
					    <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" Wrap="True" />
					    <HeaderTemplate>
					    <asp:Label ID="Label3" runat="server" Text="Chức năng" ></asp:Label>                   
					    </HeaderTemplate>
					    <ItemTemplate>                                
						    <asp:HyperLink ID="lnkEdit" runat="server" Font-Bold="true" NavigateUrl='<%# "EditNews.aspx?News_ID=" + Eval("News_ID") %>'>
							    <asp:Image ID="ImageEdit" ToolTip="Sửa thông tin" runat="server" ImageUrl="~/images/edit.PNG" />
						    </asp:HyperLink>                                
						     <asp:ImageButton ID="btnDelete" CommandArgument='<%# Eval("News_ID") %>' CommandName="delete_News"  ImageUrl="~/images/drop-no.gif" runat="server"  
						     OnClientClick = "javascript:return confirm('Bạn có chắc chắn không ?');"/>                                             
    						 
					    </ItemTemplate>
					    <ItemStyle Wrap="False" />
				    </asp:TemplateField>
			    </Columns>      
			    <PagerSettings FirstPageText="Trang đầu" LastPageText="Trang cuối" NextPageText="&gt;&gt;"
			      PageButtonCount="5" PreviousPageText="&lt;&lt;" />     
			    <FooterStyle Font-Bold="True" />
			    <selectedrowstyle font-bold="True" />
			    <headerstyle font-bold="True" />
		    </asp:GridView>
		    </form>
		    </div>
		    </div>
		    </div>
		    
</asp:Content>